FROM  nginx:alpine
ARG   CONTEXT_PATH=field-research-view
COPY  dist/ /usr/share/nginx/html/
RUN   chown -R nginx:nginx /usr/share/nginx/html;\
      sed -i "s@nginx/$nginx_version@nginx@" /etc/nginx/fastcgi_params;\
      sed -i "s@^server@server_tokens off;\nserver@" /etc/nginx/conf.d/default.conf;\
      sed -i "s@location /@client_max_body_size 10m;\n\tlocation /@" /etc/nginx/conf.d/default.conf;\
      sed -i "s@index  index.html index.htm;@index index.html;try_files \$uri \$uri/ /${CONTEXT_PATH}/index.html?\$args;@" /etc/nginx/conf.d/default.conf;\

